<template>
  <a-modal
    :visible="visible"
    :title="$t('key.shshyjs')"
    :width="1600"
    :bodyStyle="{
      height: '500px',
      overflow: 'auto'
    }"
    okText="提交审核"
    @cancel="() => { $emit('cancel') }"
    @ok="confirm"
  >
    <detail-list :col="3">
      <detail-list-item :term="$t('key.xh')">{{ rptInfo.xh }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.name')">{{ rptInfo.xm }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.sex')">{{ rptInfo.xbmc }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.birthDate')">{{ rptInfo.csrq && rptInfo.csrq.format('YYYY-MM-DD')}}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.national')">{{ rptInfo.mzmc }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.nj')">{{ rptInfo.sznjmc }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.zy')">{{ rptInfo.sszymc }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.stuCate')">{{ rptInfo.xslbmc }}&nbsp;</detail-list-item>
      <detail-list-item :term="$t('key.politicalLandscape')">{{ rptInfo.zzmmmc }}&nbsp;</detail-list-item>
	  <detail-list-item :term="$t('key.position')">{{ rptInfo.zw }}&nbsp;</detail-list-item>
	  <detail-list-item :term="$t('key.xjsj')">{{ rptInfo.xjsj }}&nbsp;</detail-list-item>
    </detail-list>
	
    </a-table>

    <a-form :form="form">
      <a-col :span="24">
        <a-form-item
          label="审核结果"
          :labelCol="{span: 3,offset: 1}"
          :wrapperCol="{span: 5}"
        >
          <a-select v-decorator="['dsshzt',
            {
              rules: [{ required: true, message: '请选择导师审核结果!' }],
            }]" >
            <a-select-option value="03">同意</a-select-option>
            <a-select-option value="04">不同意</a-select-option>
           <!-- <a-select-option value="78">建议修改或补充</a-select-option> -->
          </a-select>
        </a-form-item>
      </a-col>
      
      <a-col :span="24">
        <a-form-item
          label="导师的审核意见"
          :labelCol="{span: 3,offset: 1}"
          :wrapperCol="{span: 20}"
        >
          <a-textarea v-decorator="['dsshyj',
            {
              rules: [{ required: true, message: '请输入导师的审核意见!' }],
            }]" />
        </a-form-item>
      </a-col>
      
    </a-form>
  </a-modal>

</template>

<script>
import { STable } from '~'
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item

export default {
  props: ['visible'],
  components: {DetailList, DetailListItem, STable},
  data () {
    return {
      form: this.$form.createForm(this),
     rptInfo: {
      //   yjjds: []
      },
       /*columns: [
        {
          title: '起讫日期',
          width: 200,
          scopedSlots: { customRender: 'qsrq' }
        },
        {
          title: '主要研究内容',
          dataIndex: 'zyyjnr'
        },
        {
          title: '预期结果',
          width: 650,
          dataIndex: 'yqjg'
        }
      ], */
      tableData: [],
     /* zjcolumns: [
        {
          title: '姓名',
          scopedSlots: { customRender: 'xm' }
        },
        {
          title: '职称',
          scopedSlots: { customRender: 'zc' }
        },
        {
          title: '所在单位、现从事专业',
          scopedSlots: { customRender: 'dw' }
        },
        {
          title: '操作',
          scopedSlots: { customRender: 'action' }
        }
      ] */
    }
  },
  methods: {
    newRow () {
      /* let hasEdit = this.tableData.find(d => {
        return d.editable
      }) */
    /*  if (hasEdit) {
        return this.$message.warning('请先完成前面的添加')
      }
      this.tableData.push({
        xm: '',
        zc: '',
        dw: '',
        action: '',
        editable: true
      }) */
    },
    remove (index) {
      this.tableData.splice(index, 1)
    },
    completeAdd (data) {
     /* if (data.xm && data.zc && data.dw) {
        return this.$set(data, 'editable', false)
      }
      this.$message.error('请输入完整的评审专家信息') */
    },
    confirm () {
      this.form.validateFields((err, values) => {
        if (err) return

        // if (!this.tableData.length) {
        //   return this.$message.error('评审专家不能为空')
        // }
        let params = Object.assign({
          // yxshyj: values.yxshzt === '09' ? '同意' : (values.yxshzt === '08' ? '不同意' : '建议修改或补充'),
          shyjsId: this.rptInfo.id
          // specialist: JSON.stringify(this.tableData)
        }, values)
        this.$api.student.checkShyjs(params).then(res => {
          this.$message.success(res.msg)
          this.form.resetFields()
          this.$emit('cancel')
          this.$emit('refresh')
        })
      })
    }
  }
}
</script>

<style>

</style>
